package com.qingke.mybatis;

import org.apache.ibatis.session.SqlSession;

import com.qingke.mybatis.mapping.BlogMapper;
import com.qingke.pojo.Blog;

public class App2 {

	public static void main(String[] args) {
		
		SqlSession session = SessionManager.getInstance().getSession();
		BlogMapper mapper = session.getMapper(BlogMapper.class);
		
		Blog blog = new Blog();
		blog.setId(1);
		blog.setUserId(1);
		blog.setTitle("blog 1 updated");
		blog.setContent("blog 1 content updated");
		mapper.updateBlog(blog);
		
		session.commit();
		System.out.println(blog.getId());
		session.close();
		
	}
	
}
